home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / pmake / lst / RCS / lstForEach.c,v < prev    next >
Encoding:
Text File  |  1992-05-19  |  1.5 KB  |  72 lines

  1. head     1.8;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.8
  10. date     89.11.14.16.59.42;  author adam;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @@
  17.  
  18.  
  19.  
  20. 1.8
  21. log
  22. @checked in with -k by kupfer at 92.05.18.17.32.39.
  23. @
  24. text
  25. @/*-
  26.  * LstForeach.c --
  27.  *    Perform a given function on all elements of a list.
  28.  *
  29.  * Copyright (c) 1988 by University of California Regents
  30.  *
  31.  * Permission to use, copy, modify, and distribute this
  32.  * software and its documentation for any purpose and without
  33.  * fee is hereby granted, provided that the above copyright
  34.  * notice appears in all copies.  Neither the University of California nor
  35.  * Adam de Boor makes any representations about the suitability of this
  36.  * software for any purpose.  It is provided "as is" without
  37.  * express or implied warranty.
  38.  */
  39. #ifndef lint
  40. static char *rcsid =
  41. "$Id: lstForEach.c,v 1.8 89/11/14 16:59:42 adam Exp $ SPRITE (Berkeley)";
  42. #endif lint
  43.  
  44. #include    "lstInt.h"
  45.  
  46. /*-
  47.  *-----------------------------------------------------------------------
  48.  * Lst_ForEach --
  49.  *    Apply the given function to each element of the given list. The
  50.  *    function should return 0 if Lst_ForEach should continue and non-
  51.  *    zero if it should abort.
  52.  *
  53.  * Results:
  54.  *    None.
  55.  *
  56.  * Side Effects:
  57.  *    Only those created by the passed-in function.
  58.  *
  59.  *-----------------------------------------------------------------------
  60.  */
  61. /*VARARGS2*/
  62. void
  63. Lst_ForEach (l, proc, d)
  64.     Lst                  l;
  65.     register int    (*proc)();
  66.     register ClientData    d;
  67. {
  68.     Lst_ForEachFrom(l, Lst_First(l), proc, d);
  69. }
  70.  
  71. @
  72.